package de.mhu.mandalaui.list;

import de.mhu.mandalaui.AbstractComposite;
import de.mhu.mandalaui.Response;

public class StaticList extends AbstractComposite<ListItem, Object> {

	public void add(ListItem item) {
		add(item, null);
	}
	
	@Override
	public void render(Response response) {
		response.startTag("ul", "list-group", this);
		for (Container<ListItem, Object> item : this) {
			response.startTag("li", "list-group-item", item.getItem());
			response.containerEnter(item.getItem());
			item.getItem().render(response);
			response.containerLeave();
			response.endTag("li");
		}
		response.endTag("ul");
	}

}
